home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
snip9_91.arc
/
STRREV.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-17
|
349b
|
21 lines
/*
** STRREV.C - reverse a string in place
**
** public domain by Bob Stout
*/
#include <string.h>
char *strrev(char *str)
{
char *p1, *p2;
for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2)
{
*p1 ^= *p2;
*p2 ^= *p1;
*p1 ^= *p2;
}
return str;
}